package com.jh.user.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * @author Fuchun
 * @since 1.0
 */
@Configuration
@EnableJpaAuditing
@EnableTransactionManagement(proxyTargetClass = true)
public class JpaConfig {

    @Bean(initMethod = "init")
    public DruidDataSource dataSource() {
        return DruidDataSourceBuilder.create().build();
    }
}
